﻿using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace QuanLyNhaHang.GUI
{
    public partial class Production : Form
    {
        public Production()
        {
            InitializeComponent();
        }

        private void Production_Load(object sender, EventArgs e)
        {
            loadTMP();
        }

        private void gridView1_PopupMenuShowing_1(object sender, PopupMenuShowingEventArgs e)
        {
            GridView view = sender as GridView;

            GridHitInfo hitInfo = view.CalcHitInfo(e.Point);

            if (hitInfo.InRow)
            {
                view.FocusedRowHandle = hitInfo.RowHandle;
                contextMenuStrip1.Show(view.GridControl, e.Point);
            }
        }

        private void loadTMP()
        {
            // TODO: This line of code loads data into the 'doAnQLNhaHangDataSet1.THUC_DON' table. You can move, or remove it, as needed.
            this.tHUC_DONTableAdapter.Fill(this.doAnQLNhaHangDataSet1.THUC_DON);
            // TODO: This line of code loads data into the 'doAnQLNhaHangDataSet1.NGUYEN_LIEU' table. You can move, or remove it, as needed.
            this.nGUYEN_LIEUTableAdapter.Fill(this.doAnQLNhaHangDataSet1.NGUYEN_LIEU);
            // TODO: This line of code loads data into the 'doAnQLNhaHangDataSet1.THUC_DON' table. You can move, or remove it, as needed.

            this.tHUC_DONTableAdapter.Fill(this.doAnQLNhaHangDataSet1.THUC_DON);
            // TODO: This line of code loads data into the 'doAnQLNhaHangDataSet.THUCDON' table. You can move, or remove it, as needed.
            this.tHUC_DONTableAdapter.Fill(this.doAnQLNhaHangDataSet1.THUC_DON);
            this.nGUYEN_LIEUTableAdapter.Fill(this.doAnQLNhaHangDataSet1.NGUYEN_LIEU);
            //this.nguyenlieuTableAdapter2.Fill(this.doAnQLNhaHangDataSet1.NGUYEN_LIEU);



            listViewThucDon.Clear(); listViewThucDon.Groups.Clear();
            listViewThucDon.ShowGroups = true; listViewThucDon.View = View.Tile;
            listViewThucDon.LargeImageList = imageList1;
            //f.listViewTable.LargeImageList = f.imageList1;

            listViewThucDon.Groups.Add(new ListViewGroup("Thực đơn"));
            listViewThucDon.Groups.Add(new ListViewGroup("Các món lẫu"));
            listViewThucDon.Groups.Add(new ListViewGroup("Nước uống"));

            ListViewItem item = new ListViewItem("Tất cả thực đơn");
            item.Group = listViewThucDon.Groups[0]; item.ImageIndex = 0;
            listViewThucDon.Items.Add(item);

            ListViewItem item2 = new ListViewItem("Lẫu cá");
            item2.Group = listViewThucDon.Groups[1]; item2.ImageIndex = 0;
            listViewThucDon.Items.Add(item2);

            ListViewItem item3 = new ListViewItem("Nước có cồn");
            item3.Group = listViewThucDon.Groups[2]; item3.ImageIndex = 0;
            listViewThucDon.Items.Add(item3);

            ListViewItem item4 = new ListViewItem("Nước không cồn");
            item4.Group = listViewThucDon.Groups[2]; item4.ImageIndex = 0;
            listViewThucDon.Items.Add(item4);
        }

        private void btnMngLocation_Click(object sender, EventArgs e)
        {
            
        }
    }
}
